#include "wxsstatictext.h"

namespace {
  wxsRegisterItem<wxsStaticText> Reg( _T( "StaticText" ), _T( "标签" ), wxsTWidget, _T( "标准" ), 50 );
  WXS_ST_BEGIN( wxsStaticTextStyles, _T( "" ) )
  WXS_ST_CATEGORY( "wxStaticText" )
  WXS_ST( wxST_NO_AUTORESIZE )
  WXS_ST( wxALIGN_LEFT )
  WXS_ST( wxALIGN_RIGHT )
  WXS_ST( wxALIGN_CENTRE )
  WXS_ST_DEFAULTS()
  WXS_ST_END()
  WXS_EV_BEGIN( wxsStaticTextEvents )
  WXS_EV_END()
}

wxsStaticText::wxsStaticText( wxsItemResData* Data ):
  wxsWidget( Data, &Reg.Info, wxsStaticTextEvents, wxsStaticTextStyles ), Label( _T( "Label" ) ) {}

void wxsStaticText::OnBuildCreatingCode() {
  switch( GetLanguage() ) {
  case wxsCPP: {
    AddHeader( _T( "<wx/stattext.h>" ), GetInfo().ClassName, hfInPCH );
    Codef( _T( "%C(%W, %I, %t, %P, %S, %T, %N);\n" ), Label.wx_str() );
    BuildSetupWindowCode();
    return;
  }
  case wxsUnknownLanguage:
  default: {
    wxsCodeMarks::Unknown( _T( "wxsStaticText::OnBuildCreatingCode" ), GetLanguage() );
  }
  }
}

wxObject* wxsStaticText::OnBuildPreview( wxWindow* Parent, long Flags ) {
  wxStaticText* Preview = new wxStaticText( Parent, GetId(), Label, Pos( Parent ), Size( Parent ), Style() );
  return SetupWindow( Preview, Flags );
}

void wxsStaticText::OnEnumWidgetProperties( M_Code_unused long Flags ) {
  WXS_STRING( wxsStaticText, Label, _T( "Label" ), _T( "label" ), _T( "" ), true )
}
